package com.itheima.demo;

import com.itheima.factory.BeanFactory;
import com.itheima.pojo.Address;
import com.itheima.pojo.User;

/*
* 测试类
* */
public class DemoTest {


    public static void main(String[] args)throws Exception {
       /* User u=new User();
        System.out.println(u);*/

     /*   User u= BeanFactory.getUser();
        System.out.println(u);

        Address address=BeanFactory.getAddress();
        System.out.println(address);*/

       /* Address u1= (Address) BeanFactory.getObject();
        System.out.println(u1);*/

      /*  User user = (User) BeanFactory.getObject1("com.itheima.pojo.User");
        System.out.println(user);


        Address address = (Address) BeanFactory.getObject1("com.itheima.pojo.Address");
        System.out.println(address);*/

    /*    User u = (User) BeanFactory.getBean("user");
        System.out.println(u);

        User u1 = (User) BeanFactory.getBean("user");
        System.out.println(u1);

        Address address = (Address) BeanFactory.getBean("address");
        System.out.println(address);
*/
        User u = (User) BeanFactory.getBean("user");
        System.out.println(u);
        User u1 = (User) BeanFactory.getBean("user");
        System.out.println(u1);
    }
}
